/*
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-07-15 18:42:56
 * @LastEditTime: 2023-03-06 18:49:46
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 系统用户管理
 * @FilePath: \vue3-element-plus-web\src\api\SysManage\sysUser.js
 * @Copyright 版权声明
 */
import request from '@/utils/request'
import qs from 'qs'

/**
 * @description 获取列表
 */
export function getList(params) {
  const data = params
  return request({
    url: '/sysUser/page',
    method: 'get',
    params: data
  })
}

/**
 * @description 添加保存
 * @param {*} params
 */
export function addSave(params) {
  const data = params
  return request({
    url: '/sysUser/save',
    method: 'post',
    data
  })
}

/**
 * @description 编辑保存
 * @param {*} params
 */
export function updateSave(params) {
  const data = params
  return request({
    url: '/sysUser/submit',
    method: 'post',
    data
  })
}

/**
 * @description 删除保存
 * @param {*} params
 */
export function deleteSave(params) {
  const data = params
  return request({
    url: '/sysUser/remove',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}

/**
 * @description 重置密码
 * @param {String} id 用户id
 */
export function resetPwd(params) {
  const data = params
  return request({
    url: '/sysUser/resetPwd',
    method: 'get',
    params: data
  })
}

/**
 * @description 数据导出
 * @param {*} params
 */
export function exportData(params) {
  return request({
    url: '/sysUser/export',
    method: 'get',
    responseType: 'blob',
    headers: {
      'Response-All': true,
      'Content-Type': 'application/x-www-form-urlencoded'
      // 'Content-Type': 'application/json; application/octet-stream'
    },
    params
  })
}

export default {}
